Customize Form - States Table
The states
table in the Customize Form Doctype allows users to define custom states (or statuses) for a Doctype, often used in workflows. Each row in the states
table represents a specific state and includes fields that determine its behavior and display. Here’s an explanation of each field and its usage:
1. title
- Description: The name of the state or status.
- Use:
- Represents the current state of a document (e.g., "Draft," "Pending Approval," "Approved").
- Displayed prominently in the document header or workflow status field.
2. color
- Description: Defines the color associated with the state.
- Use:
- Helps visually differentiate between states.
- Commonly used colors include green for "Approved," red for "Rejected," and yellow for "Pending."
- Accepts color codes or predefined labels like "Red," "Green," etc.
3. idx
- Description: Specifies the order of the states in the list.
- Use:
- Controls the sequence in which states are displayed.
- Ensure logical progression (e.g., "Draft" → "Submitted" → "Approved").
4. group
- Description: Categorizes the state under a specific group.
- Use:
- Organize states for easier management.
- For example, grouping states under "Approval Flow" or "Completion Stages."
5. hidden
- Description: Determines whether the state is hidden from the user interface.
- Use:
- Hide states that are only relevant for backend processes or specific users.
- For example, a temporary state used for automated processing.
Examples of Usage:
- Basic Workflow States:
- Row 1:
title
: Draftcolor
: Grey- Use: Represents a document that is being edited but not yet finalized.
- Row 2:
title
: Submittedcolor
: Blue- Use: Indicates the document has been finalized and submitted for review.
- Row 3:
title
: Approvedcolor
: Green- Use: Marks the document as approved.
- Row 1:
- Advanced Workflow States with Hidden States:
- Row 1:
title
: Draftcolor
: Grey
- Row 2:
title
: Under Reviewcolor
: Yellow
- Row 3:
title
: Sent Backcolor
: Orange
- Row 4:
title
: Automated Processingcolor
: Redhidden
: Checked- Use: A hidden state used for system-generated actions, not visible to users.
- Row 1:
- Grouped States for Better Organization:
- Row 1:
title
: In Progresscolor
: Bluegroup
: Task Flow
- Row 2:
title
: Completedcolor
: Greengroup
: Task Flow
- Row 3:
title
: Canceledcolor
: Redgroup
: Task Flow
- Row 1:
- Custom States for a Leave Application:
- Row 1:
title
: Draftcolor
: Grey- Use: Default state for newly created leave applications.
- Row 2:
title
: Pending Approvalcolor
: Yellow- Use: Indicates that the leave application is waiting for manager approval.
- Row 3:
title
: Approvedcolor
: Green- Use: Marks the leave application as approved.
- Row 4:
title
: Rejectedcolor
: Red- Use: Indicates the leave application has been rejected.
- Row 1:
How States Are Used in Workflows:
- Display in Document Header:
- The state is often displayed prominently at the top of the document.
- Trigger Actions:
- States can trigger specific actions or transitions in workflows (e.g., send notifications on state change).
- Filter and Reports:
- Documents can be filtered by states (e.g., show all "Pending Approval" documents).
- Visual Indicators:
- Colors and titles make it easy to understand the current state of a document at a glance.
By defining custom states in the states
table, you can enhance the usability of workflows and improve document management within your ERP system.